Introduction
“You don’t hear people in college embarrassed about being in college because they don't have a job yet. You are learning, and making even a simple game is hard, especially if you want it done WELL. This is shown clearly by all the people who have NOT made even simple games but talk about it constantly. Once you have finished a game, consider yourself to have more of a track record than anyone who have not finished a game even if their idea sounds phenomenal and like it's up there with the latest cutting edge games. If you can't play it, it’s not a game.”
Gamedev article “How do I make Games” by Geoff Howland
Basic4GL and OpenGL
Basic4GL is a very limited language. But it's good enough to make a lot of simple 2d and 3d games. And it's a very good language to start learning to program. This tutorial will cover some general programming, but it's main intention is to teach game programming. You are encouraged to read the Basic4GL help files for further information. Also this is not a OpenGL tutorial. Read Nehe's tutorials or the OpenGL redbook for that.
Programming as Problem Solving
A program (as everybody knows) is a list of instructions to be executed by a machine. Like a kitchen recipe. The first basic skill of a programmer is to find out what his program is supposed to do (the problem). His second basic skill is to devise a recipe that solves his problem (the hard step). His third basic skill is to express this recipe effectively in a programming language for the computer and his fellow programmers (a step that requires a lot of technical knowledge, and good style).
In writing a large recipe the author of a cookbook might divide it into smaller recipies. He might have a recipe for such and such sauce. A recipe for such and such stuffing. And in the large recipe he might refer to these. In programming we do the same. We use the Divide and Conquer strategy to help us organize our programs. Different languages have different ways of doing this. In Basic4GL we have Subroutines.
This tutorial is a series of incomplete programs. One or more subroutines are blank. The specifications of what each subroutine should do are given to the reader. And the reader is expected to complete the program. This way we can have inmediate gratification of a usefull program, without having to learn how each detail works. The more we advance in the tutorials, the greater the part of the program that is left to the reader.
To the reader
Use your head. Think independantlly. Try out many things. Make mistakes. Get information from other sources. Introduce your own special modifications. Break and fix again. Make a bold guess and test it. If you find yourself in a problem you can't solve get all the help you can from many different sources. But remember the only person thats going to program your game is you, so concentrate on doing, not reading.